import 'package:flutter_test/flutter_test.dart';
import 'package:network_info_plus/network_info_plus.dart';
import 'package:network_info_plus/network_info_plus_platform_interface.dart';
import 'package:network_info_plus/network_info_plus_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockNetworkInfoPlusPlatform
    with MockPlatformInterfaceMixin
    implements NetworkInfoPlusPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final NetworkInfoPlusPlatform initialPlatform = NetworkInfoPlusPlatform.instance;

  test('$MethodChannelNetworkInfoPlus is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelNetworkInfoPlus>());
  });

  test('getPlatformVersion', () async {
    NetworkInfoPlus networkInfoPlusPlugin = NetworkInfoPlus();
    MockNetworkInfoPlusPlatform fakePlatform = MockNetworkInfoPlusPlatform();
    NetworkInfoPlusPlatform.instance = fakePlatform;

    expect(await networkInfoPlusPlugin.getPlatformVersion(), '42');
  });
}
